<template>
	<div class="order-item">
		<div class="flex flex-s-c">
			<div>单号：{{ info.TransferNo }}</div>
			<div class="color-gray-light">{{ info.AddTime }}</div>
		</div>
		<div v-if="boundType === 0" style="color:#6290fc;" class="mtb-10">发货人： {{ info.OutStoreName }}( {{ info.OutUserCard }} )</div>
		<div v-if="boundType === 1" style="color:#6290fc;" class="mtb-10">申请人： {{ info.InStoreName }}( {{ info.InUserCard }} )</div>
		<div class="order-item-main" v-if="info.DetailList && info.DetailList.length > 0">
			<div style="color:#feb468;" class="mb-10">调拨商品({{ info.StockModeName }})</div>
			<div class="order-item-imgs" >
				<div class="img-item" v-for="(item,index) in info.DetailList.slice(0,3)" :key="index">
					<img-box :img-url="item.ProductImage" class="br-10 is-140" />
				</div>
				<div class="right">
					<div class="right-box">
						<span class="right-box-text" v-if="info.DetailList.length>4">···</span>
						<span class="right-box-text" v-if="info.DetailList.length>4">共{{getTotalNum()}}种</span>
					</div>
				</div>
			</div>
			<div class="flex-fe-c color-gray-light">共{{ getTotalNum() }}件</div>
		</div>
	</div>
</template>
<script>
import imgBox from 'components/imgBox'
export default {
	components: {
    imgBox
  },
	props: {
		info: {
			type: Object,
			required: true,
		},
		boundType: {
			type: Number,
			default: 0,
		}
	},
	methods: {
		getTotalNum(){
			let num = 0;
			this.info.DetailList.forEach(e=>{
				num +=e.Amount
			})
			return num;
		},
	}
}
</script>
<style lang="scss" scoped>
.order-item {
  background: #fff;
  border-radius: 10px;
  // position: relative;
  margin-bottom: 20px;
  height: auto;
  .order-item-top {
    padding: 30;
    border-bottom: solid 1px #666666;
    display: flex;
    flex-direction: column;

    .order-desc-text:first-child {
      margin-bottom: 10px;
    }
    .supplier-box {
      padding: 6px 0;
      .icon-dianpu {
        font-size: 32px;
        margin-right: 10px;
      }
      .supplier-name {
        font-size: 30px;
      }
    }
  }

  .order-item-main {
    padding: 10px 0 30px;
    border-bottom: solid 1px #ebebeb;
    display: flex;
    flex-direction: column;

    .order-item-imgs {
      display: flex;
      flex: 1;
      flex-direction: row;
      .order-item-name {
        font-size: 28px;
        color: #333333;
        display: flex;
        align-items: center;
      }
      .img-item {
        position: relative;
        margin-right: 15px;

        .order-item-img {
          display: flex;
          width: 120px;
          height: 120px;
          // border: 1px solid $app-color-main;
          border-radius: 10px;
        }

        .text-num {
          display: flex;
          justify-content: center;
          align-items: center;
          position: absolute;
          bottom: 0;
          left: 0;
          right: 0;
          height: 40px;
          border-bottom-left-radius: 10px;
          border-bottom-right-radius: 10px;
          color: white;
          background: rgba(#000000, 0.3);
          font-size: 24px;
        }
      }
    }

    .icon {
      color: red;
    }
  }

  .order-item-price {
    padding: 0 30px;
    // border-bottom: solid 1px $uni-border-bottom-color;
    display: flex;
    flex-direction: row;
    height: 92px;
    line-height: 92px;
    .kind {
      color: #333333;
      font-size: 24px;
      text {
        padding-right: 32px;
      }
    }
    .order-desc {
      text {
        margin-right: 20px;
      }
    }

    .order-price {
      display: flex;
      flex: 1;
      justify-content: flex-end;

      text {
        color: #333;
        font-size: 24px;
      }

      .price-text {
        font-weight: 700;
        margin-left: 20px;
        color: $color3;
        //color: #fa6400;
        font-size: 24px;
      }
    }
  }

  .order-item-bottom {
    padding: 12px 30px 30px 30px;
  }

  .order-state {
    padding: 0 30px;
    height: 48px;
    font-size: 24px;
    color: white;
    background: #fdb52a;
    position: absolute;
    right: -10px;
    top: 30px;
    z-index: 2;
    border-radius: 24px 0px 0px 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    &:after {
      content: '';
      position: absolute;
      right: 0px;
      top: 48px;
      width: 0;
      height: 0;
      border-top: 10px solid #c78609;
      border-right: 10px solid transparent;
      z-index: 1;
    }
  }

  .order-desc-text {
    font-size: 24px;
    color: $color6;
  }
}
</style>
